package com.lcz.authority.common.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhou.starter.jpacomment.annotation.ColumnComment;
import com.zhou.starter.jpacomment.annotation.TableComment;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author lcz
 * @desc 用户和岗位关联 sys_user_post
 * @mail lcz_0130@163.com
 * @date 2024/06/14
 */
@Data
@TableName("sys_user_post")
@Table(name = "sys_user_post")
@Entity
@TableComment("用户和岗位表")
public class SysUserPostEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @ColumnComment("主键id")
    private String id;
    /**
     * 用户ID
     */
    @Setter
    @Getter
    @ColumnComment("用户ID")
    private Long userId;

    /**
     * 岗位ID
     */
    @Setter
    @Getter
    @ColumnComment("岗位ID")
    private Long postId;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("postId", getPostId())
                .toString();
    }
}
